#include "../syncup-service-bindings.h"
#include "../syncup-service.h"
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
    gchar *path;
    GError *err = NULL;
    DBusGConnection *conn;
    DBusGProxy *proxy;

    g_type_init();
    if (!g_thread_supported()) {
        g_thread_init(NULL);
    }
    dbus_g_thread_init();

    if (argc < 2) {
        fprintf(stderr, "Usage: %s <path>\n", argv[0]);
        exit(1);
    }
    path = argv[1];

    conn = dbus_g_bus_get(DBUS_BUS_SESSION, &err);
    proxy = dbus_g_proxy_new_for_name(conn, SYNCUP_SERVICE_DBUS_NAME,
            SYNCUP_SERVICE_DBUS_PATH, SYNCUP_SERVICE_DBUS_INTERFACE);
    if (!org_syncup_Service_label_path(proxy, path, &err)) {
        fprintf(stderr, "%s\n", err->message);
    }

    return 0;
}
